home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Appearance.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  78.1 KB  |  2,218 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Appearance.a
  3. ;
  4. ;    Contains:    Appearance Manager & SDK Interfaces.
  5. ;
  6. ;    Version:    Technology:    Appearance 1.0
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1994-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__APPEARANCE__') = 'UNDEFINED' THEN
  19. __APPEARANCE__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__MACWINDOWS__') = 'UNDEFINED' THEN
  25.     include 'MacWindows.a'
  26.     ENDIF
  27.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  28.     include 'Quickdraw.a'
  29.     ENDIF
  30.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  31.     include 'Dialogs.a'
  32.     ENDIF
  33.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  34.     include 'Files.a'
  35.     ENDIF
  36.     IF &TYPE('__ICONS__') = 'UNDEFINED' THEN
  37.     include 'Icons.a'
  38.     ENDIF
  39.     IF &TYPE('__CONTROLS__') = 'UNDEFINED' THEN
  40.     include 'Controls.a'
  41.     ENDIF
  42.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  43.     include 'TextEdit.a'
  44.     ENDIF
  45.     IF &TYPE('__QDOFFSCREEN__') = 'UNDEFINED' THEN
  46.     include 'QDOffscreen.a'
  47.     ENDIF
  48.     IF &TYPE('__TEXTCOMMON__') = 'UNDEFINED' THEN
  49.     include 'TextCommon.a'
  50.     ENDIF
  51.  
  52. ; ——————————————————————————————————————————————————————————————————————————————————
  53. ;  Appearance Manager constants, etc.                                                
  54. ; ——————————————————————————————————————————————————————————————————————————————————
  55.  
  56.                                                             ; Appearance Trap Number 
  57. _AppearanceDispatch                EQU        $AA74
  58. ;  Gestalt selector and values for the Appearance Manager 
  59.  
  60. gestaltAppearanceAttr            EQU        'appr'
  61. gestaltAppearanceExists            EQU        0
  62. gestaltAppearanceCompatMode        EQU        1
  63. ;  Appearance Manager Error Codes 
  64.  
  65. appearanceBadBrushIndexErr        EQU        -30560                ; pattern index invalid 
  66. appearanceProcessRegisteredErr    EQU        -30561
  67. appearanceProcessNotRegisteredErr EQU    -30562
  68. appearanceBadTextColorIndexErr    EQU        -30563
  69.  
  70. kThemeActiveDialogBackgroundBrush EQU    1                    ; Dialogs 
  71. kThemeInactiveDialogBackgroundBrush EQU    2                    ; Dialogs 
  72. kThemeActiveAlertBackgroundBrush EQU    3
  73. kThemeInactiveAlertBackgroundBrush EQU    4
  74. kThemeActiveModelessDialogBackgroundBrush EQU 5
  75. kThemeInactiveModelessDialogBackgroundBrush EQU 6
  76. kThemeActiveUtilityWindowBackgroundBrush EQU 7                ; Miscellaneous 
  77. kThemeInactiveUtilityWindowBackgroundBrush EQU 8            ; Miscellaneous 
  78. kThemeListViewSortColumnBackgroundBrush EQU 9                ; Finder 
  79. kThemeListViewBackgroundBrush    EQU        10
  80. kThemeIconLabelBackgroundBrush    EQU        11
  81. kThemeListViewSeparatorBrush    EQU        12
  82. kThemeChasingArrowsBrush        EQU        13
  83. kThemeDragHiliteBrush            EQU        14
  84. kThemeDocumentWindowBackgroundBrush EQU    15
  85. kThemeFinderWindowBackgroundBrush EQU    16
  86. ; typedef SInt16                         ThemeBrush
  87.  
  88.  
  89. kThemeActiveDialogTextColor        EQU        1                    ; Dialogs 
  90. kThemeInactiveDialogTextColor    EQU        2
  91. kThemeActiveAlertTextColor        EQU        3
  92. kThemeInactiveAlertTextColor    EQU        4
  93. kThemeActiveModelessDialogTextColor EQU    5
  94. kThemeInactiveModelessDialogTextColor EQU 6
  95. kThemeActiveWindowHeaderTextColor EQU    7                    ; Primitives 
  96. kThemeInactiveWindowHeaderTextColor EQU    8
  97. kThemeActivePlacardTextColor    EQU        9                    ; Primitives 
  98. kThemeInactivePlacardTextColor    EQU        10
  99. kThemePressedPlacardTextColor    EQU        11
  100. kThemeActivePushButtonTextColor    EQU        12                    ; Primitives 
  101. kThemeInactivePushButtonTextColor EQU    13
  102. kThemePressedPushButtonTextColor EQU    14
  103. kThemeActiveBevelButtonTextColor EQU    15                    ; Primitives 
  104. kThemeInactiveBevelButtonTextColor EQU    16
  105. kThemePressedBevelButtonTextColor EQU    17
  106. kThemeActivePopupButtonTextColor EQU    18                    ; Primitives 
  107. kThemeInactivePopupButtonTextColor EQU    19
  108. kThemePressedPopupButtonTextColor EQU    20
  109. kThemeIconLabelTextColor        EQU        21                    ; Finder 
  110. kThemeListViewTextColor            EQU        22
  111. ; typedef SInt16                         ThemeTextColor
  112.  
  113. ;  States to draw primitives: disabled, active, and pressed (hilited) 
  114.  
  115. kThemeStateDisabled                EQU        0
  116. kThemeStateActive                EQU        1
  117. kThemeStatePressed                EQU        2
  118. ; typedef UInt32                         ThemeDrawState
  119.  
  120. ; ——————————————————————————————————————————————————————————————————————————————————
  121. ;  Window Manager constants, etc.                                                    
  122. ; ——————————————————————————————————————————————————————————————————————————————————
  123.  
  124.                                                             ; Resource IDs for new window defprocs 
  125. kWindowDocumentDefProcResID        EQU        64
  126. kWindowDialogDefProcResID        EQU        65
  127. kWindowUtilityDefProcResID        EQU        66
  128. kWindowUtilitySideTitleDefProcResID EQU    67
  129.  
  130.                                                             ; Proc IDs for theme-savvy windows 
  131. kWindowDocumentProc                EQU        1024
  132. kWindowGrowDocumentProc            EQU        1025
  133. kWindowHorizZoomDocumentProc    EQU        1026
  134. kWindowHorizZoomGrowDocumentProc EQU    1027
  135. kWindowVertZoomDocumentProc        EQU        1028
  136. kWindowVertZoomGrowDocumentProc    EQU        1029
  137. kWindowFullZoomDocumentProc        EQU        1030
  138. kWindowFullZoomGrowDocumentProc    EQU        1031
  139.  
  140.                                                             ; Proc IDs for theme-savvy dialogs 
  141. kWindowPlainDialogProc            EQU        1040
  142. kWindowShadowDialogProc            EQU        1041
  143. kWindowModalDialogProc            EQU        1042
  144. kWindowMovableModalDialogProc    EQU        1043
  145. kWindowAlertProc                EQU        1044
  146. kWindowMovableAlertProc            EQU        1045
  147.  
  148.                                                             ; Proc IDs for top title bar theme-savvy floating windows 
  149. kWindowFloatProc                EQU        1057
  150. kWindowFloatGrowProc            EQU        1059
  151. kWindowFloatHorizZoomProc        EQU        1061
  152. kWindowFloatHorizZoomGrowProc    EQU        1063
  153. kWindowFloatVertZoomProc        EQU        1065
  154. kWindowFloatVertZoomGrowProc    EQU        1067
  155. kWindowFloatFullZoomProc        EQU        1069
  156. kWindowFloatFullZoomGrowProc    EQU        1071
  157.  
  158.                                                             ; Proc IDs for side title bar theme-savvy floating windows 
  159. kWindowFloatSideProc            EQU        1073
  160. kWindowFloatSideGrowProc        EQU        1075
  161. kWindowFloatSideHorizZoomProc    EQU        1077
  162. kWindowFloatSideHorizZoomGrowProc EQU    1079
  163. kWindowFloatSideVertZoomProc    EQU        1081
  164. kWindowFloatSideVertZoomGrowProc EQU    1083
  165. kWindowFloatSideFullZoomProc    EQU        1085
  166. kWindowFloatSideFullZoomGrowProc EQU    1087
  167.  
  168.                                                             ; Region values to pass into GetWindowRegion 
  169. kWindowTitleBarRgn                EQU        0
  170. kWindowTitleTextRgn                EQU        1
  171. kWindowCloseBoxRgn                EQU        2
  172. kWindowZoomBoxRgn                EQU        3
  173. kWindowDragRgn                    EQU        5
  174. kWindowGrowRgn                    EQU        6
  175. kWindowCollapseBoxRgn            EQU        7
  176. kWindowStructureRgn                EQU        32
  177. kWindowContentRgn                EQU        33
  178. ; typedef UInt16                         WindowRegionCode
  179.  
  180.  
  181.                                                             ; Window Features returned by GetWindowFeatures 
  182. kWindowCanGrow                    EQU        $01
  183. kWindowCanZoom                    EQU        $02
  184. kWindowCanCollapse                EQU        $04
  185. kWindowIsModal                    EQU        $08
  186. kWindowCanGetWindowRegion        EQU        $10
  187. kWindowIsAlert                    EQU        $20
  188. kWindowHasTitleBar                EQU        $40
  189.  
  190.                                                             ; New window messages 
  191. kWindowMsgGetFeatures            EQU        7
  192. kWindowMsgGetRegion                EQU        8
  193.  
  194.                                                             ; New Window part codes 
  195. inCollapseBox                    EQU        11
  196.  
  197.                                                             ; Window Definition hit test result codes ("WindowPart")
  198. wInCollapseBox                    EQU        9
  199. ;  Window positioning constants 
  200.  
  201. kWindowDefaultPosition            EQU        $0000
  202. kWindowCenterMainScreen            EQU        $280A
  203. kWindowAlertPositionMainScreen    EQU        $300A
  204. kWindowStaggerMainScreen        EQU        $380A
  205. kWindowCenterParentWindow        EQU        $A80A
  206. kWindowAlertPositionParentWindow EQU    $B00A
  207. kWindowStaggerParentWindow        EQU        $B80A
  208. kWindowCenterParentWindowScreen    EQU        $680A
  209. kWindowAlertPositionParentWindowScreen EQU $700A
  210. kWindowStaggerParentWindowScreen EQU    $780A
  211. ;  GetWindowRegionRec - used for WDEF calls with kWindowMsgGetRegion 
  212. GetWindowRegionRec        RECORD 0
  213. winRgn                     ds.l    1                ; offset: $0 (0)
  214. regionCode                 ds.w    1                ; offset: $4 (4)
  215. sizeof                     EQU *                    ; size:   $6 (6)
  216.                         ENDR
  217. ; typedef struct GetWindowRegionRec *    GetWindowRegionPtr
  218.  
  219. ; ——————————————————————————————————————————————————————————————————————————————————
  220. ;  Dialog Manager constants, etc.                                                    
  221. ; ——————————————————————————————————————————————————————————————————————————————————
  222.  
  223.                                                             ; Alert types to pass into StandardAlert 
  224. kAlertStopAlert                    EQU        0
  225. kAlertNoteAlert                    EQU        1
  226. kAlertCautionAlert                EQU        2
  227. kAlertPlainAlert                EQU        3
  228. ; typedef SInt16                         AlertType
  229.  
  230.  
  231. kAlertDefaultOKText                EQU        -1                    ; "OK"
  232. kAlertDefaultCancelText            EQU        -1                    ; "Cancel"
  233. kAlertDefaultOtherText            EQU        -1                    ; "Don't Save"
  234. ;  StandardAlert alert button numbers 
  235.  
  236. kAlertStdAlertOKButton            EQU        1
  237. kAlertStdAlertCancelButton        EQU        2
  238. kAlertStdAlertOtherButton        EQU        3
  239. kAlertStdAlertHelpButton        EQU        4
  240.  
  241.                                                             ; Dialog Flags for use in NewFeaturesDialog or dlgx resource 
  242. kDialogFlagsUseThemeBackground    EQU        $01
  243. kDialogFlagsUseControlHierarchy    EQU        $02
  244. kDialogFlagsHandleMovableModal    EQU        $04
  245. kDialogFlagsUseThemeControls    EQU        $08
  246.  
  247.                                                             ; Alert Flags for use in alrx resource 
  248. kAlertFlagsUseThemeBackground    EQU        $01
  249. kAlertFlagsUseControlHierarchy    EQU        $02
  250. kAlertFlagsAlertIsMovable        EQU        $04
  251. kAlertFlagsUseThemeControls        EQU        $08
  252. ;  For dftb resource 
  253.  
  254. kDialogFontNoFontStyle            EQU        0
  255. kDialogFontUseFontMask            EQU        $0001
  256. kDialogFontUseFaceMask            EQU        $0002
  257. kDialogFontUseSizeMask            EQU        $0004
  258. kDialogFontUseForeColorMask        EQU        $0008
  259. kDialogFontUseBackColorMask        EQU        $0010
  260. kDialogFontUseModeMask            EQU        $0020
  261. kDialogFontUseJustMask            EQU        $0040
  262. kDialogFontUseAllMask            EQU        $00FF
  263. kDialogFontAddFontSizeMask        EQU        $0100
  264. kDialogFontUseFontMaskMask        EQU        $0200
  265. AlertStdAlertParamRec    RECORD 0
  266. movable                     ds.b    1                ; offset: $0 (0)        ;  Make alert movable modal 
  267. helpButton                 ds.b    1                ; offset: $1 (1)        ;  Is there a help button? 
  268. filterProc                 ds.l    1                ; offset: $2 (2)        ;  Event filter 
  269. defaultText                 ds.l    1                ; offset: $6 (6)        ;  Text for button in OK position 
  270. cancelText                 ds.l    1                ; offset: $A (10)        ;  Text for button in cancel position 
  271. otherText                 ds.l    1                ; offset: $E (14)        ;  Text for button in left position 
  272. defaultButton             ds.w    1                ; offset: $12 (18)        ;  Which button behaves as the default 
  273. cancelButton             ds.w    1                ; offset: $14 (20)        ;  Which one behaves as cancel (can be 0) 
  274. position                 ds.w    1                ; offset: $16 (22)        ;  Position (kWindowDefaultPosition in this case 
  275. ;  equals kWindowAlertPositionParentWindowScreen) 
  276. sizeof                     EQU *                    ; size:   $18 (24)
  277.                         ENDR
  278. ; typedef struct AlertStdAlertParamRec * AlertStdAlertParamPtr
  279.  
  280. ; ——————————————————————————————————————————————————————————————————————————————————
  281. ;  Control Manager constants, etc.                                                    
  282. ; ——————————————————————————————————————————————————————————————————————————————————
  283.  
  284. _ControlDispatch                EQU        $AA73
  285.  
  286.                                                             ; resource types for new controls 
  287. kControlTabListResType            EQU        'tab#'                ; used for tab control only
  288. kControlListDescResType            EQU        'ldes'                ; used for list box control only
  289.  
  290.                                                             ; new part codes for new controls 
  291. kControlEditTextPart            EQU        5
  292. kControlPicturePart                EQU        6
  293. kControlIconPart                EQU        7
  294. kControlClockPart                EQU        8
  295. kControlListBoxPart                EQU        24
  296. kControlListBoxDoubleClickPart    EQU        25
  297.  
  298. kControlSupportsNewMessages        EQU        ' ok '                ; CDEF should return as result of kControlMsgTestNewMsgSupport
  299. ;  focusing part codes 
  300.  
  301. kControlFocusNoPart                EQU        0                    ; tells control to clear its focus
  302. kControlFocusNextPart            EQU        -1                    ; tells control to focus on the next part
  303. kControlFocusPrevPart            EQU        -2                    ; tells control to focus on the previous part
  304. ; typedef SInt16                         ControlFocusPart
  305.  
  306. ;  Key Filter result codes                                                             
  307. ;                                                                                     
  308. ;  Certain controls can have a keyfilter attached to them. The filter proc should    
  309. ;  return one of the two constants below. If kKeyFilterBlockKey is returned, the    
  310. ;  key is blocked and never makes it to the control. If kKeyFilterPassKey is        
  311. ;  returned, the control receives the keystroke.                                    
  312.  
  313. kControlKeyFilterBlockKey        EQU        0
  314. kControlKeyFilterPassKey        EQU        1
  315. ; typedef SInt16                         ControlKeyFilterResult
  316.  
  317. ; ——————————————————————————————————————————————————————————————————————————————————————
  318. ;      SPECIAL FONT USAGE NOTES: You can specify the font to use for many control types.
  319. ;    The constants below are meta-font numbers which you can use to set a particular
  320. ;    control's font usage. There are essentially two modes you can use: 1) default,
  321. ;    which is essentially the same as it always has been, i.e. it uses the system font, unless
  322. ;    directed to use the window font via a control variant. 2) you can specify to use
  323. ;    the big or small system font in a generic manner. The Big system font is the font
  324. ;    used in menus, etc. Chicago has filled that role for some time now. Small system
  325. ;    font is currently Geneva 10. The meta-font number implies the size and style.
  326. ;    
  327. ;    NOTE:        Not all font attributes are used by all controls. Most, in fact, ignore
  328. ;                the fore and back color (Static Text is the only one that does, for
  329. ;                backwards compatibility). Also size, face, and addFontSize are ignored
  330. ;                when using the meta-font numbering.
  331. ;
  332.  
  333. ; ——————————————————————————————————————————————————————————————————————————————————————
  334.  
  335.                                                             ; Meta-font numbering - see not above 
  336. kControlFontBigSystemFont        EQU        -1                    ; force to big system font
  337. kControlFontSmallSystemFont        EQU        -2                    ; force to small system font
  338. kControlFontSmallBoldSystemFont    EQU        -3                    ; force to small bold system font
  339. ;  Add these masks together to set the flags field of a ControlFontStyleRec    
  340. ;  They specify which fields to apply to the text. It is important to make    
  341. ;  sure that you specify only the fields that you wish to set.                
  342.  
  343. kControlUseFontMask                EQU        $0001
  344. kControlUseFaceMask                EQU        $0002
  345. kControlUseSizeMask                EQU        $0004
  346. kControlUseForeColorMask        EQU        $0008
  347. kControlUseBackColorMask        EQU        $0010
  348. kControlUseModeMask                EQU        $0020
  349. kControlUseJustMask                EQU        $0040
  350. kControlUseAllMask                EQU        $00FF
  351. kControlAddFontSizeMask            EQU        $0100
  352. ControlFontStyleRec        RECORD 0
  353. flags                     ds.w    1                ; offset: $0 (0)
  354. font                     ds.w    1                ; offset: $2 (2)
  355. size                     ds.w    1                ; offset: $4 (4)
  356. style                     ds.w    1                ; offset: $6 (6)
  357. mode                     ds.w    1                ; offset: $8 (8)
  358. just                     ds.w    1                ; offset: $A (10)
  359. foreColor                 ds        RGBColor        ; offset: $C (12)
  360. backColor                 ds        RGBColor        ; offset: $12 (18)
  361. sizeof                     EQU *                    ; size:   $18 (24)
  362.                         ENDR
  363. ; typedef struct ControlFontStyleRec *    ControlFontStylePtr
  364.  
  365. ; ——————————————————————————————————————————————————————————————————————————————————————
  366. ;  Common data tags for Get/SetControlData                                                
  367. ; ——————————————————————————————————————————————————————————————————————————————————————
  368.  
  369. kControlFontStyleTag            EQU        'font'
  370. kControlKeyFilterTag            EQU        'fltr'
  371. ; ——————————————————————————————————————————————————————————————————————————————————————
  372. ;  Errors are in the range -30580 .. -30599                                                
  373. ; ——————————————————————————————————————————————————————————————————————————————————————
  374.  
  375. errMessageNotSupported            EQU        -30580
  376. errDataNotSupported                EQU        -30581
  377. errControlDoesntSupportFocus    EQU        -30582
  378. errWindowDoesntSupportFocus        EQU        -30583
  379. errUnknownControl                EQU        -30584
  380. errCouldntSetFocus                EQU        -30585
  381. errNoRootControl                EQU        -30586
  382. errRootAlreadyExists            EQU        -30587
  383. errInvalidPartCode                EQU        -30588
  384. errControlsAlreadyExist            EQU        -30589
  385. errControlIsNotEmbedder            EQU        -30590
  386. errDataSizeMismatch                EQU        -30591
  387. errControlHiddenOrDisabled        EQU        -30592
  388. errWindowRegionCodeInvalid        EQU        -30593
  389. errCantEmbedIntoSelf            EQU        -30594
  390. errCantEmbedRoot                EQU        -30595
  391. errItemNotControl                EQU        -30596
  392.  
  393.                                                             ; Control feature bits - returned by GetControlFeatures 
  394. kControlSupportsGhosting        EQU        $01
  395. kControlSupportsEmbedding        EQU        $02
  396. kControlSupportsFocus            EQU        $04
  397. kControlWantsIdle                EQU        $08
  398. kControlWantsActivate            EQU        $10
  399. kControlHandlesTracking            EQU        $20
  400. kControlSupportsDataAccess        EQU        $40
  401. kControlHasSpecialBackground    EQU        $80
  402. kControlGetsFocusOnClick        EQU        $0100
  403. kControlSupportsCalcBestRect    EQU        $0200
  404. kControlSupportsLiveFeedback    EQU        $0400
  405.  
  406.                                                             ; Control Messages 
  407. kControlMsgDrawGhost            EQU        13
  408. kControlMsgCalcBestRect            EQU        14                    ; Calculate best fitting rectangle for control
  409. kControlMsgHandleTracking        EQU        15
  410. kControlMsgFocus                EQU        16                    ; param indicates action.
  411. kControlMsgKeyDown                EQU        17
  412. kControlMsgIdle                    EQU        18
  413. kControlMsgGetFeatures            EQU        19
  414. kControlMsgSetData                EQU        20
  415. kControlMsgGetData                EQU        21
  416. kControlMsgActivate                EQU        22
  417. kControlMsgSetUpBackground        EQU        23
  418. kControlMsgCalcValue            EQU        24
  419. kControlMsgSubControlHit        EQU        25
  420. kControlMsgCalcValueFromPos        EQU        26
  421. kControlMsgTestNewMsgSupport    EQU        27                    ; See if this control supports new messaging
  422. ; ——————————————————————————————————————————————————————————————————————————————————————
  423. ;      This structure is passed into a CDEF when called with the kControlMsgHandleTracking    
  424. ;     message                                                                             
  425. ; ——————————————————————————————————————————————————————————————————————————————————————
  426. ControlTrackingRec        RECORD 0
  427. startPt                     ds        Point            ; offset: $0 (0)
  428. modifiers                 ds.w    1                ; offset: $4 (4)
  429. action                     ds.l    1                ; offset: $6 (6)
  430. sizeof                     EQU *                    ; size:   $A (10)
  431.                         ENDR
  432. ; typedef struct ControlTrackingRec *    ControlTrackingPtr
  433.  
  434. ; ——————————————————————————————————————————————————————————————————————————————————————
  435. ;  This structure is passed into a CDEF when called with the kControlMsgKeyDown message 
  436. ; ——————————————————————————————————————————————————————————————————————————————————————
  437. ControlKeyDownRec        RECORD 0
  438. modifiers                 ds.w    1                ; offset: $0 (0)
  439. keyCode                     ds.w    1                ; offset: $2 (2)
  440. charCode                 ds.w    1                ; offset: $4 (4)
  441. sizeof                     EQU *                    ; size:   $6 (6)
  442.                         ENDR
  443. ; typedef struct ControlKeyDownRec *    ControlKeyDownPtr
  444.  
  445. ; ——————————————————————————————————————————————————————————————————————————————————————
  446. ;  This structure is passed into a CDEF when called with the kControlMsgGetData or        
  447. ;  kControlMsgSetData message                                                             
  448. ; ——————————————————————————————————————————————————————————————————————————————————————
  449. ControlDataAccessRec    RECORD 0
  450. tag                         ds.l    1                ; offset: $0 (0)
  451. part                     ds.l    1                ; offset: $4 (4)
  452. size                     ds.l    1                ; offset: $8 (8)
  453. dataPtr                     ds.l    1                ; offset: $C (12)
  454. sizeof                     EQU *                    ; size:   $10 (16)
  455.                         ENDR
  456. ; typedef struct ControlDataAccessRec *    ControlDataAccessPtr
  457.  
  458. ; ——————————————————————————————————————————————————————————————————————————————————————
  459. ;  This structure is passed into a CDEF when called with the kControlCalcBestRect msg     
  460. ; ——————————————————————————————————————————————————————————————————————————————————————
  461. ControlCalcSizeRec        RECORD 0
  462. height                     ds.w    1                ; offset: $0 (0)
  463. width                     ds.w    1                ; offset: $2 (2)
  464. baseLine                 ds.w    1                ; offset: $4 (4)
  465. sizeof                     EQU *                    ; size:   $6 (6)
  466.                         ENDR
  467. ; typedef struct ControlCalcSizeRec *    ControlCalcSizePtr
  468.  
  469. ; ——————————————————————————————————————————————————————————————————————————————————————
  470. ;  This structure is passed into a CDEF when called with the kControlMsgSetUpBackground 
  471. ;  message is sent                                                                        
  472. ; ——————————————————————————————————————————————————————————————————————————————————————
  473. ControlBackgroundRec    RECORD 0
  474. depth                     ds.w    1                ; offset: $0 (0)
  475. colorDevice                 ds.b    1                ; offset: $2 (2)
  476.                          ORG 4
  477. sizeof                     EQU *                    ; size:   $4 (4)
  478.                         ENDR
  479. ; typedef struct ControlBackgroundRec *    ControlBackgroundPtr
  480.  
  481. ; ——————————————————————————————————————————————————————————————————————————————————————
  482. ;     Key Filter                                                                            
  483. ;                                                                                         
  484. ;  Definition of a key filter for intercepting and possibly changing keystrokes            
  485. ;  which are destined for a control                                                        
  486. ; ——————————————————————————————————————————————————————————————————————————————————————
  487. ; ——————————————————————————————————————————————————————————————————————————————————————
  488. ;     • BEVEL BUTTON INTERFACE (CDEF 2)                                                    
  489. ; ——————————————————————————————————————————————————————————————————————————————————————
  490. ;     Bevel buttons allow you to control the content type (pict/icon/etc.), the behavior    
  491. ;  (pushbutton/toggle/sticky), and the bevel size. You also have the option of            
  492. ;     attaching a menu to it. When a menu is present, you can specify which way the         
  493. ;     popup arrow is facing (down or right).                                                
  494. ;                                                                                         
  495. ;     This is all made possible by overloading the Min, Max, and Value parameters for the    
  496. ;     control, as well as adjusting the variant. Here's the breakdown of what goes where:    
  497. ;                                                                                         
  498. ;     Parameter                    What Goes Here                                            
  499. ;     ———————————————————            ————————————————————————————————————————————————————    
  500. ;     Min                            Hi Byte = Behavior, Lo Byte = content type.                
  501. ;     Max                            ResID for resource-based content types.                    
  502. ;     Value                        MenuID to attach, 0 = no menu, please.                    
  503. ;                                                                                         
  504. ;     The variant is broken down into two halfs. The low 2 bits control the bevel type.    
  505. ;     Bit 2 controls the popup arrow direction (if a menu is present) and bit 3 controls    
  506. ;     whether or not to use the control's owning window's font.                            
  507. ;                                                                                         
  508. ;     Constants for all you need to put this together are below. The values for behaviors    
  509. ;     are set up so that you can simply add them to the content type and pass them into    
  510. ;     the Min parameter of NewControl.                                                    
  511. ;                                                                                         
  512. ;     An example call:                                                                    
  513. ;                                                                                         
  514. ;     control = NewControl( window, &bounds, "\p", true, 0, kContentIconSuiteRes +         
  515. ;                             kBehaviorToggles, myIconSuiteID, bevelButtonSmallBevelProc,    
  516. ;                             0L );                                                        
  517. ;                                                                                         
  518. ;     Attaching a menu:                                                                    
  519. ;                                                                                         
  520. ;     control = NewControl( window, &bounds, "\p", true, kMyMenuID, kContentIconSuiteRes,    
  521. ;             myIconSuiteID, bevelButtonSmallBevelProc + kBevelButtonMenuOnRight, 0L );    
  522. ;                                                                                         
  523. ;     This will attach menu ID kMyMenuID to the button, with the popup arrow facing right.
  524. ;     This also puts the menu up to the right of the button. You can also specify that a    
  525. ;     menu can have multiple items checked at once by adding kBehaviorMultiValueMenus        
  526. ;     into the Min parameter. If you do use multivalue menus, the GetBevelButtonMenuValue    
  527. ;     helper function will return the last item chosen from the menu, whether or not it    
  528. ;     was checked.                                                                        
  529. ;                                                                                         
  530. ;     NOTE:     Bevel buttons with menus actually have *two* values. The value of the         
  531. ;             button (on/off), and the value of the menu. The menu value can be gotten    
  532. ;             with the GetBevelButtonMenuValue helper function.                            
  533. ;                                                                                         
  534. ;     Handle-based Content                                                                
  535. ;     ————————————————————                                                                
  536. ;     You can create your control and then set the content to an existing handle to an    
  537. ;     icon suite, etc. using the macros below. Please keep in mind that resource-based    
  538. ;     content is owned by the control, handle-based content is owned by you. The CDEF will
  539. ;     not try to dispose of handle-based content. If you are changing the content type of    
  540. ;     the button on the fly, you must make sure that if you are replacing a handle-        
  541. ;     based content with a resource-based content to properly dispose of the handle,        
  542. ;     else a memory leak will ensue.                                                        
  543. ;                                                                                         
  544.  
  545.                                                             ; Bevel Button Proc IDs 
  546. kControlBevelButtonSmallBevelProc EQU    32
  547. kControlBevelButtonNormalBevelProc EQU    33
  548. kControlBevelButtonLargeBevelProc EQU    34
  549.  
  550.                                                             ; Bevel button graphic alignment values 
  551. kControlBevelButtonAlignSysDirection EQU -1                    ; only left or right
  552. kControlBevelButtonAlignCenter    EQU        0
  553. kControlBevelButtonAlignLeft    EQU        1
  554. kControlBevelButtonAlignRight    EQU        2
  555. kControlBevelButtonAlignTop        EQU        3
  556. kControlBevelButtonAlignBottom    EQU        4
  557. kControlBevelButtonAlignTopLeft    EQU        5
  558. kControlBevelButtonAlignBottomLeft EQU    6
  559. kControlBevelButtonAlignTopRight EQU    7
  560. kControlBevelButtonAlignBottomRight EQU    8
  561. ; typedef SInt16                         ControlButtonGraphicAlignment
  562.  
  563.  
  564.                                                             ; Bevel button text alignment values 
  565. kControlBevelButtonAlignTextSysDirection EQU 0
  566. kControlBevelButtonAlignTextCenter EQU    1
  567. kControlBevelButtonAlignTextFlushRight EQU -1
  568. kControlBevelButtonAlignTextFlushLeft EQU -2
  569. ; typedef SInt16                         ControlButtonTextAlignment
  570.  
  571.  
  572.                                                             ; Bevel button text placement values 
  573. kControlBevelButtonPlaceSysDirection EQU -1                    ; if graphic on right, then on left
  574. kControlBevelButtonPlaceNormally EQU    0
  575. kControlBevelButtonPlaceToRightOfGraphic EQU 1
  576. kControlBevelButtonPlaceToLeftOfGraphic EQU 2
  577. kControlBevelButtonPlaceBelowGraphic EQU 3
  578. kControlBevelButtonPlaceAboveGraphic EQU 4
  579. ; typedef SInt16                         ControlButtonTextPlacement
  580.  
  581. ;  Add these variant codes to kBevelButtonSmallBevelProc to change the type of button 
  582.  
  583. kControlBevelButtonSmallBevelVariant EQU 0
  584. kControlBevelButtonNormalBevelVariant EQU $01
  585. kControlBevelButtonLargeBevelVariant EQU $02
  586. kControlBevelButtonMenuOnRight    EQU        $04
  587.  
  588. ;   Behaviors of bevel buttons. These are set up so you can add
  589. ;   them together with the content types.
  590.  
  591.  
  592.  
  593. kControlBehaviorPushbutton        EQU        0
  594. kControlBehaviorToggles            EQU        $0100
  595. kControlBehaviorSticky            EQU        $0200
  596. kControlBehaviorMultiValueMenu    EQU        $4000                ; only makes sense when a menu is attached.
  597. kControlBehaviorOffsetContents    EQU        $8000
  598. ;  Content types supported by bevel buttons *and* image wells
  599.  
  600. kControlContentTextOnly            EQU        0
  601. kControlContentIconSuiteRes        EQU        1
  602. kControlContentCIconRes            EQU        2
  603. kControlContentPictRes            EQU        3
  604. kControlContentIconSuiteHandle    EQU        129
  605. kControlContentCIconHandle        EQU        130
  606. kControlContentPictHandle        EQU        131
  607. kControlContentIconRef            EQU        132
  608. ; typedef SInt16                         ControlContentType
  609.  
  610. ;  Data tags supported by the bevel button controls 
  611.  
  612. kControlBevelButtonContentTag    EQU        'cont'                ; ButtonContentInfo
  613. kControlBevelButtonTransformTag    EQU        'tran'                ; IconTransformType
  614. kControlBevelButtonTextAlignTag    EQU        'tali'                ; ButtonTextAlignment
  615. kControlBevelButtonTextOffsetTag EQU    'toff'                ; SInt16
  616. kControlBevelButtonGraphicAlignTag EQU    'gali'                ; ButtonGraphicAlignment
  617. kControlBevelButtonGraphicOffsetTag EQU    'goff'                ; Point
  618. kControlBevelButtonTextPlaceTag    EQU        'tplc'                ; ButtonTextPlacement
  619. kControlBevelButtonMenuValueTag    EQU        'mval'                ; SInt16
  620. kControlBevelButtonMenuHandleTag EQU    'mhnd'                ; MenuHandle
  621. ;  Structure to pass into bevel buttons and image wells to set/get content type 
  622. ControlButtonContentInfo RECORD 0
  623. contentType                 ds.w    1                ; offset: $0 (0)
  624. resID                     ds.w    1                ; offset: $2 (2)
  625.                          ORG 2
  626. cIconHandle                 ds.l    1                ; offset: $2 (2)
  627.                          ORG 2
  628. iconSuite                 ds.l    1                ; offset: $2 (2)
  629.                          ORG 2
  630. iconRef                     ds.l    1                ; offset: $2 (2)
  631.                          ORG 2
  632. picture                     ds.l    1                ; offset: $2 (2)
  633. sizeof                     EQU *                    ; size:   $6 (6)
  634.                         ENDR
  635. ; typedef struct ControlButtonContentInfo * ControlButtonContentInfoPtr
  636.  
  637. ; ——————————————————————————————————————————————————————————————————————————————————————
  638. ;     • SLIDER (CDEF 3)                                                                    
  639. ; ——————————————————————————————————————————————————————————————————————————————————————
  640. ;     There are several variants that control the behavior of the slider control. Any        
  641. ;     combination of the following three constants can be added to the basic CDEF ID        
  642. ;     (kSliderProc).                                                                        
  643. ;                                                                                         
  644. ;     Variants:                                                                            
  645. ;                                                                                         
  646. ;         kSliderLiveFeedback         Slider does not use "ghosted" indicator when tracking.    
  647. ;                                 ActionProc is called (set via SetControlAction) as the    
  648. ;                                 indicator is dragged. The value is updated so that the    
  649. ;                                 actionproc can adjust some other property based on the    
  650. ;                                 value each time the action proc is called. If no action    
  651. ;                                 proc is installed, it reverts to the ghost indicator.    
  652. ;                                                                                         
  653. ;         kSliderHasTickMarks         Slider is drawn with 'tick marks'. The control            
  654. ;                                 rectangle must be large enough to accomidate the tick    
  655. ;                                 marks.                                                    
  656. ;/*        kSliderReverseDirection    Slider thumb points in opposite direction than normal.    
  657. ;                                 If the slider is vertical, the thumb will point to the    
  658. ;                                 left, if the slider is horizontal, the thumb will point    
  659. ;                                 upwards.                                                
  660. ;                                                                                         
  661. ;         kSliderNonDirectional    This option overrides the kSliderReverseDirection and    
  662. ;                                 kSliderHasTickMarks variants. It creates an indicator    
  663. ;                                 which is rectangular and doesn't point in any direction    
  664. ;                                 like the normal indicator does.                            
  665.  
  666.                                                             ; Slider proc IDs 
  667. kControlSliderProc                EQU        48
  668. kControlSliderLiveFeedback        EQU        $01
  669. kControlSliderHasTickMarks        EQU        $02
  670. kControlSliderReverseDirection    EQU        $04
  671. kControlSliderNonDirectional    EQU        $08
  672.  
  673. ; ——————————————————————————————————————————————————————————————————————————————————————
  674. ;     • DISCLOSURE TRIANGLE (CDEF 4)                                                        
  675. ; ——————————————————————————————————————————————————————————————————————————————————————
  676. ;     This control can be used as either left or right facing. It can also handle its own    
  677. ;     tracking if you wish. This means that when the 'autotoggle' variant is used, if the    
  678. ;     user clicks the control, it's state will change automatically from open to closed    
  679. ;     and vice-versa depending on its initial state. After a successful call to Track-    
  680. ;      Control, you can just check the current value to see what state it was switched to.    
  681.  
  682.                                                             ; Triangle proc IDs 
  683. kControlTriangleProc            EQU        64
  684. kControlTriangleLeftFacingProc    EQU        65
  685. kControlTriangleAutoToggleProc    EQU        66
  686. kControlTriangleLeftFacingAutoToggleProc EQU 67
  687.  
  688.                                                             ; Tagged data supported by disclosure triangles 
  689. kControlTriangleLastValueTag    EQU        'last'                ; SInt16
  690. ; ——————————————————————————————————————————————————————————————————————————————————————
  691. ;     • PROGRESS INDICATOR (CDEF 5)                                                        
  692. ; ——————————————————————————————————————————————————————————————————————————————————————
  693. ;     This CDEF implements both determinate and indeterminate progress bars. To switch,     
  694. ;     just use SetControlData to set the indeterminate flag to make it indeterminate call    
  695. ;     IdleControls to step thru the animation. IdleControls should be called at least        
  696. ;     once during your event loop.                                                        
  697. ;                                                                                         
  698.  
  699.                                                             ; Progress Bar proc IDs 
  700. kControlProgressBarProc            EQU        80
  701.  
  702.                                                             ; Tagged data supported by progress bars 
  703. kControlProgressBarIndeterminateTag EQU    'inde'                ; Boolean
  704. ; ——————————————————————————————————————————————————————————————————————————————————————
  705. ;     • LITTLE ARROWS (CDEF 6)                                                            
  706. ; ——————————————————————————————————————————————————————————————————————————————————————
  707. ;      This control implements the little up and down arrows you'd see in the Memory        
  708. ;     control panel for adjusting the cache size.                                         
  709.  
  710.                                                             ; Little Arrows proc IDs 
  711. kControlLittleArrowsProc        EQU        96
  712. ; ——————————————————————————————————————————————————————————————————————————————————————
  713. ;     • CHASING ARROWS (CDEF 7)                                                            
  714. ; ——————————————————————————————————————————————————————————————————————————————————————
  715. ;     To animate this control, make sure to call IdleControls repeatedly.                    
  716. ;                                                                                         
  717.  
  718.                                                             ; Chasing Arrows proc IDs 
  719. kControlChasingArrowsProc        EQU        112
  720. ; ——————————————————————————————————————————————————————————————————————————————————————
  721. ;     • TABS (CDEF 8)                                                                        
  722. ; ——————————————————————————————————————————————————————————————————————————————————————
  723. ;     Tabs use an auxiliary resource (tab#) to hold tab information such as the tab name    
  724. ;     and an icon suite ID for each tab.                                                    
  725. ;                                                                                         
  726. ;     The ID of the tab# resource that you wish to associate with a tab control should     
  727. ;     be passed in as the Value parameter of the control. If you are using GetNewControl, 
  728. ;     then the Value slot in the CNTL resource should have the ID of the 'tab#' resource    
  729. ;     on creation.                                                                        
  730. ;                                                                                         
  731.  
  732.                                                             ; Tabs proc IDs 
  733. kControlTabLargeProc            EQU        128                    ; Large tab size    
  734. kControlTabSmallProc            EQU        129                    ; Small tab size    
  735.  
  736.                                                             ; Tagged data supported by progress bars 
  737. kControlTabContentRectTag        EQU        'rect'                ; Rect
  738. kControlTabEnabledFlagTag        EQU        'enab'                ; Boolean
  739. kControlTabFontStyleTag            EQU        'font'                ; ControlFontStyleRec
  740. ; ——————————————————————————————————————————————————————————————————————————————————————
  741. ;     • VISUAL SEPARATOR (CDEF 9)                                                            
  742. ; ——————————————————————————————————————————————————————————————————————————————————————
  743. ;     Separator lines determine their orientation (horizontal or vertical) automatically    
  744. ;     based on the relative height and width of their contrlRect.                            
  745.  
  746.                                                             ; Visual separator proc IDs 
  747. kControlSeparatorLineProc        EQU        144
  748.  
  749. ; ——————————————————————————————————————————————————————————————————————————————————————
  750. ;     • GROUP BOX (CDEF 10)                                                                
  751. ; ——————————————————————————————————————————————————————————————————————————————————————
  752. ;     The group box CDEF can be use in several ways. It can have no title, a text title,     
  753. ;     a check box as the title, or a popup button as a title. There are two versions of     
  754. ;     group boxes, primary and secondary, which look slightly different.                    
  755.  
  756.                                                             ; Group Box proc IDs 
  757. kControlGroupBoxTextTitleProc    EQU        160
  758. kControlGroupBoxCheckBoxProc    EQU        161
  759. kControlGroupBoxPopupButtonProc    EQU        162
  760. kControlGroupBoxSecondaryTextTitleProc EQU 164
  761. kControlGroupBoxSecondaryCheckBoxProc EQU 165
  762. kControlGroupBoxSecondaryPopupButtonProc EQU 166
  763.  
  764.                                                             ; Tagged data supported by group box 
  765. kControlGroupBoxMenuHandleTag    EQU        'mhan'                ; MenuHandle (popup title only)
  766. kControlGroupBoxFontStyleTag    EQU        'font'                ; ControlFontStyleRec
  767. ; ——————————————————————————————————————————————————————————————————————————————————————
  768. ;     • IMAGE WELL (CDEF 11)                                                                
  769. ; ——————————————————————————————————————————————————————————————————————————————————————
  770. ;     Image Wells allow you to control the content type (pict/icon/etc.) shown in the     
  771. ;     well.                                                                                
  772. ;                                                                                         
  773. ;     This is made possible by overloading the Min and Value parameters for the control.    
  774. ;                                                                                         
  775. ;     Parameter                    What Goes Here                                            
  776. ;     ———————————————————            ——————————————————————————————————————————————————        
  777. ;     Min                            content type (see constants for bevel buttons)            
  778. ;     Value                        Resource ID of content type, if resource-based.            
  779. ;                                                                                         
  780. ;                                                                                         
  781. ;     Checked State                                                                        
  782. ;     —————————————                                                                        
  783. ;     The checked state is enabled by setting the value of the control to 1, just like a     
  784. ;     check box.                                                                            
  785. ;                                                                                         
  786. ;     Handle-based Content                                                                
  787. ;     ————————————————————                                                                
  788. ;     You can create your control and then set the content to an existing handle to an    
  789. ;     icon suite, etc. using the macros below. Please keep in mind that resource-based    
  790. ;     content is owned by the control, handle-based content is owned by you. The CDEF will
  791. ;     not try to dispose of handle-based content. If you are changing the content type of    
  792. ;     the button on the fly, you must make sure that if you are replacing a handle-        
  793. ;     based content with a resource-based content to properly dispose of the handle,        
  794. ;     else a memory leak will ensue.                                                        
  795. ;                                                                                         
  796. ;                                                                                         
  797. ;     AutoTracking                                                                        
  798. ;     ————————————                                                                        
  799. ;     Image Wells are capable of autotracking. The current autotracking feature sets the     
  800. ;     value itself, so that the control remains hilited. It behaves as a sort of palette     
  801. ;     type object where clicking selects it, it cannot be delected by clicking it again,     
  802. ;     clicking on another object should cause the focus to change (as in Get Info windows)
  803. ;     and the application should then set the value to 0 to take away the checked border.    
  804. ;                                                                                         
  805.  
  806.                                                             ; Image Well proc IDs 
  807. kControlImageWellProc            EQU        176
  808. kControlImageWellAutoTrackProc    EQU        177
  809.  
  810.                                                             ; Tagged data supported by image wells 
  811. kControlImageWellContentTag        EQU        'cont'                ; ButtonContentInfo
  812. kControlImageWellTransformTag    EQU        'tran'                ; IconTransformType
  813. ; ——————————————————————————————————————————————————————————————————————————————————————
  814. ;     • POPUP ARROW (CDEF 12)                                                                
  815. ; ——————————————————————————————————————————————————————————————————————————————————————
  816. ;     The popup arrow CDEF is used to draw the small arrow normally associated with a     
  817. ;     popup control. The arrow can point in four directions, and a small or large version 
  818. ;     can be used. This control is provided to allow clients to draw the arrow in a         
  819. ;     normalized fashion which will take advantage of themes automatically.                
  820. ;                                                                                         
  821.  
  822.                                                             ; Popup Arrow proc IDs 
  823. kControlPopupArrowEastProc        EQU        192
  824. kControlPopupArrowWestProc        EQU        193
  825. kControlPopupArrowNorthProc        EQU        194
  826. kControlPopupArrowSouthProc        EQU        195
  827. kControlPopupArrowSmallEastProc    EQU        196
  828. kControlPopupArrowSmallWestProc    EQU        197
  829. kControlPopupArrowSmallNorthProc EQU    198
  830. kControlPopupArrowSmallSouthProc EQU    199
  831. ; ——————————————————————————————————————————————————————————————————————————————————————
  832. ;     • PLACARD (CDEF 14)                                                                    
  833. ; ——————————————————————————————————————————————————————————————————————————————————————
  834.  
  835.                                                             ; Placard proc IDs 
  836. kControlPlacardProc                EQU        224
  837. ; ——————————————————————————————————————————————————————————————————————————————————————
  838. ;     • CLOCK (CDEF 15)                                                                    
  839. ; ——————————————————————————————————————————————————————————————————————————————————————
  840. ;      NOTE:    You can specify more options in the Value paramter when creating the clock.    
  841. ;             See below.                                                                    
  842.  
  843.                                                             ; Clock proc IDs 
  844. kControlClockTimeProc            EQU        240
  845. kControlClockTimeSecondsProc    EQU        241
  846. kControlClockDateProc            EQU        242
  847. kControlClockMonthYearProc        EQU        243
  848. ; ——————————————————————————————————————————————————————————————————————————————————————
  849. ;      These flags can be passed into 'value' field on creation of the control.            
  850. ;      Value is set to 0 after control is created.                                            
  851. ;                                                                                         
  852. ;     The kClockIsLive value tells the clock to automatically update on idle (clock will    
  853. ;     have the current time). This flag is only valid when the kClockIsDisplayOnly flag    
  854. ;     is set.                                                                                
  855. ; ——————————————————————————————————————————————————————————————————————————————————————
  856.  
  857. kControlClockNoFlags            EQU        0
  858. kControlClockIsDisplayOnly        EQU        1
  859. kControlClockIsLive                EQU        2
  860.  
  861.                                                             ; Tagged data supported by clocks 
  862. kControlClockLongDateTag        EQU        'date'                ; LongDateRec
  863. kControlClockFontStyleTag        EQU        'font'                ; ControlFontStyleRec
  864. ; ——————————————————————————————————————————————————————————————————————————————————————
  865. ;     • USER PANE (CDEF 16)                                                                
  866. ; ——————————————————————————————————————————————————————————————————————————————————————
  867.  
  868.                                                             ; User Pane proc IDs 
  869. kControlUserPaneProc            EQU        256
  870. ;  Tagged data supported by user panes 
  871. ;  Currently, they are all proc ptrs for doing things like drawing and hit testing, etc. 
  872.  
  873. kControlUserItemDrawProcTag        EQU        'uidp'                ; UserItemUPP
  874. kControlUserPaneDrawProcTag        EQU        'draw'                ; ControlUserPaneDrawingUPP
  875. kControlUserPaneHitTestProcTag    EQU        'hitt'                ; ControlUserPaneHitTestUPP
  876. kControlUserPaneTrackingProcTag    EQU        'trak'                ; ControlUserPaneTrackingUPP
  877. kControlUserPaneIdleProcTag        EQU        'idle'                ; ControlUserPaneIdleUPP
  878. kControlUserPaneKeyDownProcTag    EQU        'keyd'                ; ControlUserPaneKeyDownUPP
  879. kControlUserPaneActivateProcTag    EQU        'acti'                ; ControlUserPaneActivateUPP
  880. kControlUserPaneFocusProcTag    EQU        'foci'                ; ControlUserPaneFocusUPP
  881. kControlUserPaneBackgroundProcTag EQU    'back'                ; ControlUserPaneBackgroundUPP
  882.  
  883. ;  ——————————————————————————————————————————————————————————————————————————————————————————
  884. ;      • EDIT TEXT (CDEF 17)
  885. ;  ——————————————————————————————————————————————————————————————————————————————————————————
  886.  
  887.  
  888.  
  889.                                                             ; Edit Text proc IDs 
  890. kControlEditTextProc            EQU        272
  891. kControlEditTextDialogProc        EQU        273
  892. kControlEditTextPasswordProc    EQU        274
  893.  
  894.                                                             ; Tagged data supported by edit text 
  895. kControlEditTextStyleTag        EQU        'font'                ; ControlFontStyleRec
  896. kControlEditTextTextTag            EQU        'text'                ; Buffer of chars - you supply the buffer
  897. kControlEditTextTEHandleTag        EQU        'than'                ; The TEHandle of the text edit record
  898. kControlEditTextKeyFilterTag    EQU        'fltr'
  899. kControlEditTextSelectionTag    EQU        'sele'                ; EditTextSelectionRec
  900. kControlEditTextPasswordTag        EQU        'pass'                ; The clear text password text
  901. ControlEditTextSelectionRec RECORD 0
  902. ;  Structure for getting the edit text selection 
  903. selStart                 ds.w    1                ; offset: $0 (0)
  904. selEnd                     ds.w    1                ; offset: $2 (2)
  905. sizeof                     EQU *                    ; size:   $4 (4)
  906.                         ENDR
  907. ; typedef struct ControlEditTextSelectionRec * ControlEditTextSelectionPtr
  908.  
  909. ; ——————————————————————————————————————————————————————————————————————————————————————
  910. ;     • STATIC TEXT (CDEF 18)                                                                
  911. ; ——————————————————————————————————————————————————————————————————————————————————————
  912. ;  Static Text proc IDs 
  913.  
  914. kControlStaticTextProc            EQU        288
  915. ;  Tagged data supported by static text 
  916.  
  917. kControlStaticTextStyleTag        EQU        'font'                ; ControlFontStyleRec
  918. kControlStaticTextTextTag        EQU        'text'                ; Copy of text
  919. kControlStaticTextTextHeightTag    EQU        'thei'                ; SInt16
  920. ; ——————————————————————————————————————————————————————————————————————————————————————
  921. ;     • PICTURE CONTROL (CDEF 19)                                                            
  922. ; ——————————————————————————————————————————————————————————————————————————————————————
  923. ;     Value parameter should contain the ID of the picture you wish to display when        
  924. ;     creating controls of this type. If you don't want the control tracked at all, use     
  925. ;     the 'no track' variant.                                                                
  926.  
  927.                                                             ; Picture control proc IDs 
  928. kControlPictureProc                EQU        304
  929. kControlPictureNoTrackProc        EQU        305                    ; immediately returns kControlPicturePart
  930. ; ——————————————————————————————————————————————————————————————————————————————————————
  931. ;     • ICON CONTROL (CDEF 20)                                                            
  932. ; ——————————————————————————————————————————————————————————————————————————————————————
  933. ;     Value parameter should contain the ID of the ICON or cicn you wish to display when    
  934. ;     creating controls of this type. If you don't want the control tracked at all, use     
  935. ;     the 'no track' variant.                                                                
  936. ;  Icon control proc IDs 
  937.  
  938. kControlIconProc                EQU        320
  939. kControlIconNoTrackProc            EQU        321                    ; immediately returns kControlIconPart
  940. kControlIconSuiteProc            EQU        322
  941. kControlIconSuiteNoTrackProc    EQU        323                    ; immediately returns kControlIconPart
  942. ;  Tagged data supported by icon controls 
  943.  
  944. kControlIconTransformTag        EQU        'trfm'                ; IconTransformType
  945. kControlIconAlignmentTag        EQU        'algn'                ; IconAlignmentType
  946. ; ——————————————————————————————————————————————————————————————————————————————————————
  947. ;     • WINDOW HEADER (CDEF 21)                                                            
  948. ; ——————————————————————————————————————————————————————————————————————————————————————
  949.  
  950.                                                             ; Window Header proc IDs 
  951. kControlWindowHeaderProc        EQU        336                    ; normal header
  952. kControlWindowListViewHeaderProc EQU    337                    ; variant for list views - no bottom line
  953. ; ——————————————————————————————————————————————————————————————————————————————————————
  954. ;     • LIST BOX (CDEF 22)                                                                
  955. ; ——————————————————————————————————————————————————————————————————————————————————————
  956. ;     Lists use an auxiliary resource to define their format. The resource type used is     
  957. ;     'ldes' and a definition for it can be found in Appearance.r. The resource ID for     
  958. ;     the ldes is passed in the 'value' parameter when creating the control.                
  959.  
  960.                                                             ; List Box proc IDs 
  961. kControlListBoxProc                EQU        352
  962. kControlListBoxAutoSizeProc        EQU        353
  963.  
  964.                                                             ; Tagged data supported by list box 
  965. kControlListBoxListHandleTag    EQU        'lhan'                ; ListHandle
  966. kControlListBoxKeyFilterTag        EQU        'fltr'                ; ControlKeyFilterUPP
  967. kControlListBoxFontStyleTag        EQU        'font'                ; ControlFontStyleRec
  968. ; ——————————————————————————————————————————————————————————————————————————————————————
  969. ;     • PUSH BUTTON (CDEF 23)                                                                
  970. ; ——————————————————————————————————————————————————————————————————————————————————————
  971. ;     The new standard checkbox and radio button controls support a "mixed" value that    
  972. ;     indicates that the current setting contains a mixed set of on and off values. The     
  973. ;     control value used to display this indication is defined in Controls.h:                
  974. ;                                                                                         
  975. ;         kControlCheckBoxMixedValue = 2                                                    
  976. ;                                                                                         
  977. ;     Two new variants of the standard pushbutton have been added to the standard control    
  978. ;     suite that draw a color icon next to the control title. One variant draws the icon    
  979. ;     on the left side, the other draws it on the right side (when the system justifica-    
  980. ;     tion is right to left, these are reversed).                                            
  981. ;                                                                                         
  982. ;     When either of the icon pushbuttons are created, the contrlMax field of the control 
  983. ;     record is used to determine the ID of the 'cicn' resource drawn in the pushbutton.    
  984. ;                                                                                         
  985. ;     In addition, a push button can now be told to draw with a default outline using the    
  986. ;     SetControlData routine with the kPushButtonDefaultTag below.                        
  987. ;                                                                                         
  988.  
  989.                                                             ; Theme Push Button/Check Box/Radio Button proc IDs 
  990. kControlPushButtonProc            EQU        368
  991. kControlCheckBoxProc            EQU        369
  992. kControlRadioButtonProc            EQU        370
  993. kControlPushButLeftIconProc        EQU        374                    ; Standard pushbutton with left-side icon
  994. kControlPushButRightIconProc    EQU        375                    ; Standard pushbutton with right-side icon
  995.  
  996.                                                             ; Tagged data supported by standard buttons 
  997. kControlPushButtonDefaultTag    EQU        'dflt'                ; default ring flag
  998. ; ——————————————————————————————————————————————————————————————————————————————————————
  999. ;     • SCROLL BAR (CDEF 24)                                                                
  1000. ; ——————————————————————————————————————————————————————————————————————————————————————
  1001. ;     This is the new Appearance scroll bar.                                                
  1002. ;                                                                                         
  1003.  
  1004.                                                             ; Theme Scroll Bar proc IDs 
  1005. kControlScrollBarProc            EQU        384                    ; normal scroll bar
  1006. kControlScrollBarLiveProc        EQU        386                    ; live scrolling variant
  1007. ; ——————————————————————————————————————————————————————————————————————————————————————
  1008. ;     • POPUP BUTTON (CDEF 25)                                                            
  1009. ; ——————————————————————————————————————————————————————————————————————————————————————
  1010. ;     This is the new Appearance Popup Button. It takes the same variants and does the     
  1011. ;     same overloading as the previous popup menu control. There are some differences:    
  1012. ;                                                                                         
  1013. ;     Passing in a menu ID of -12345 causes the popup not to try and get the menu from a    
  1014. ;     resource. Instead, you can build the menu and later stuff the menuhandle field in     
  1015. ;     the popup data information.                                                            
  1016. ;                                                                                         
  1017. ;     You can pass -1 in the Max parameter to have the control calculate the width of the    
  1018. ;     title on its own instead of guessing and then tweaking to get it right. It adds the    
  1019. ;     appropriate amount of space between the title and the popup.                        
  1020. ;                                                                                         
  1021.  
  1022.                                                             ; Theme Popup Button proc IDs 
  1023. kControlPopupButtonProc            EQU        400
  1024. kControlPopupFixedWidthVariant    EQU        $01
  1025. kControlPopupVariableWidthVariant EQU    $02
  1026. kControlPopupUseAddResMenuVariant EQU    $04
  1027. kControlPopupUseWFontVariant    EQU        $08
  1028. ; ——————————————————————————————————————————————————————————————————————————————————
  1029. ;  Menu Manager constants, etc.                                                        
  1030. ; ——————————————————————————————————————————————————————————————————————————————————
  1031.  
  1032. kMenuStdMenuProc                EQU        63
  1033. kMenuStdMenuBarProc                EQU        63
  1034.  
  1035. kMenuNoModifiers                EQU        0                    ; Mask for no modifiers
  1036. kMenuShiftModifier                EQU        $01                    ; Mask for shift key modifier
  1037. kMenuOptionModifier                EQU        $02                    ; Mask for option key modifier
  1038. kMenuControlModifier            EQU        $04                    ; Mask for control key modifier
  1039. kMenuNoCommandModifier            EQU        $08                    ; Mask for no command key modifier
  1040.  
  1041. kMenuNoIcon                        EQU        0                    ; No icon
  1042. kMenuIconType                    EQU        1                    ; Type for ICON
  1043. kMenuShrinkIconType                EQU        2                    ; Type for ICON plotted 16 x 16
  1044. kMenuSmallIconType                EQU        3                    ; Type for SICN
  1045. kMenuColorIconType                EQU        4                    ; Type for cicn
  1046. kMenuIconSuiteType                EQU        5                    ; Type for Icon Suite
  1047. kMenuIconRefType                EQU        6                    ; Type for Icon Ref
  1048. ; ——————————————————————————————————————————————————————————————————————————————————
  1049. ;     Appearance Manager APIs                                                            
  1050. ; ——————————————————————————————————————————————————————————————————————————————————
  1051. ;  Registering Appearance-Savvy Applications 
  1052. ;
  1053. ; pascal OSStatus RegisterAppearanceClient(void)
  1054. ;
  1055.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1056.         Macro
  1057.         _RegisterAppearanceClient
  1058.             move.w              #$0015,D0
  1059.             dc.w                $AA74
  1060.         EndM
  1061.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1062.         IMPORT_CFM_FUNCTION RegisterAppearanceClient
  1063.     ENDIF
  1064.  
  1065. ;
  1066. ; pascal OSStatus UnregisterAppearanceClient(void)
  1067. ;
  1068.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1069.         Macro
  1070.         _UnregisterAppearanceClient
  1071.             move.w              #$0016,D0
  1072.             dc.w                $AA74
  1073.         EndM
  1074.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1075.         IMPORT_CFM_FUNCTION UnregisterAppearanceClient
  1076.     ENDIF
  1077.  
  1078. ; *****************************************************************************
  1079. ;    NOTES ON THEME BRUSHES
  1080. ;    Theme brushes can be either colors or patterns, depending on the theme.
  1081. ;    Because of this, you should be prepared to handle the case where a brush
  1082. ;    is a pattern and save and restore the pnPixPat and bkPixPat fields of
  1083. ;    your GrafPorts when saving the fore and back colors. Also, since patterns
  1084. ;    in bkPixPat override the background color of the window, you should use
  1085. ;    BackPat to set your background pattern to a normal white pattern. This
  1086. ;    will ensure that you can use RGBBackColor to set your back color to white,
  1087. ;    call EraseRect and get the expected results.
  1088. ;****************************************************************************
  1089.  
  1090.  
  1091. ;
  1092. ; pascal OSStatus SetThemePen(ThemeBrush brush, SInt16 depth, Boolean colorDevice)
  1093. ;
  1094.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1095.         Macro
  1096.         _SetThemePen
  1097.             move.w              #$0001,D0
  1098.             dc.w                $AA74
  1099.         EndM
  1100.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1101.         IMPORT_CFM_FUNCTION SetThemePen
  1102.     ENDIF
  1103.  
  1104. ;
  1105. ; pascal OSStatus SetThemeBackground(ThemeBrush brush, SInt16 depth, Boolean colorDevice)
  1106. ;
  1107.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1108.         Macro
  1109.         _SetThemeBackground
  1110.             move.w              #$0002,D0
  1111.             dc.w                $AA74
  1112.         EndM
  1113.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1114.         IMPORT_CFM_FUNCTION SetThemeBackground
  1115.     ENDIF
  1116.  
  1117. ;
  1118. ; pascal OSStatus SetThemeTextColor(ThemeTextColor color, SInt16 depth, Boolean colorDevice)
  1119. ;
  1120.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1121.         Macro
  1122.         _SetThemeTextColor
  1123.             move.w              #$0003,D0
  1124.             dc.w                $AA74
  1125.         EndM
  1126.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1127.         IMPORT_CFM_FUNCTION SetThemeTextColor
  1128.     ENDIF
  1129.  
  1130. ;
  1131. ; pascal OSStatus SetThemeWindowBackground(WindowPtr window, ThemeBrush brush, Boolean update)
  1132. ;
  1133.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1134.         Macro
  1135.         _SetThemeWindowBackground
  1136.             move.w              #$0004,D0
  1137.             dc.w                $AA74
  1138.         EndM
  1139.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1140.         IMPORT_CFM_FUNCTION SetThemeWindowBackground
  1141.     ENDIF
  1142.  
  1143.  
  1144. ;  Window Placards, Headers and Frames 
  1145. ;
  1146. ; pascal OSStatus DrawThemeWindowHeader(const Rect *rect, ThemeDrawState state)
  1147. ;
  1148.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1149.         Macro
  1150.         _DrawThemeWindowHeader
  1151.             move.w              #$0005,D0
  1152.             dc.w                $AA74
  1153.         EndM
  1154.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1155.         IMPORT_CFM_FUNCTION DrawThemeWindowHeader
  1156.     ENDIF
  1157.  
  1158. ;
  1159. ; pascal OSStatus DrawThemeWindowListViewHeader(const Rect *rect, ThemeDrawState state)
  1160. ;
  1161.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1162.         Macro
  1163.         _DrawThemeWindowListViewHeader
  1164.             move.w              #$0006,D0
  1165.             dc.w                $AA74
  1166.         EndM
  1167.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1168.         IMPORT_CFM_FUNCTION DrawThemeWindowListViewHeader
  1169.     ENDIF
  1170.  
  1171. ;
  1172. ; pascal OSStatus DrawThemePlacard(const Rect *rect, ThemeDrawState state)
  1173. ;
  1174.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1175.         Macro
  1176.         _DrawThemePlacard
  1177.             move.w              #$0007,D0
  1178.             dc.w                $AA74
  1179.         EndM
  1180.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1181.         IMPORT_CFM_FUNCTION DrawThemePlacard
  1182.     ENDIF
  1183.  
  1184. ;
  1185. ; pascal OSStatus DrawThemeEditTextFrame(const Rect *rect, ThemeDrawState state)
  1186. ;
  1187.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1188.         Macro
  1189.         _DrawThemeEditTextFrame
  1190.             move.w              #$0009,D0
  1191.             dc.w                $AA74
  1192.         EndM
  1193.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1194.         IMPORT_CFM_FUNCTION DrawThemeEditTextFrame
  1195.     ENDIF
  1196.  
  1197. ;
  1198. ; pascal OSStatus DrawThemeListBoxFrame(const Rect *rect, ThemeDrawState state)
  1199. ;
  1200.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1201.         Macro
  1202.         _DrawThemeListBoxFrame
  1203.             move.w              #$000A,D0
  1204.             dc.w                $AA74
  1205.         EndM
  1206.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1207.         IMPORT_CFM_FUNCTION DrawThemeListBoxFrame
  1208.     ENDIF
  1209.  
  1210. ;  Keyboard Focus Drawing 
  1211. ;
  1212. ; pascal OSStatus DrawThemeFocusRect(const Rect *rect, Boolean hasFocus)
  1213. ;
  1214.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1215.         Macro
  1216.         _DrawThemeFocusRect
  1217.             move.w              #$000B,D0
  1218.             dc.w                $AA74
  1219.         EndM
  1220.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1221.         IMPORT_CFM_FUNCTION DrawThemeFocusRect
  1222.     ENDIF
  1223.  
  1224. ;  Dialog Group Boxes and Separators 
  1225. ;
  1226. ; pascal OSStatus DrawThemePrimaryGroup(const Rect *rect, ThemeDrawState state)
  1227. ;
  1228.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1229.         Macro
  1230.         _DrawThemePrimaryGroup
  1231.             move.w              #$000C,D0
  1232.             dc.w                $AA74
  1233.         EndM
  1234.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1235.         IMPORT_CFM_FUNCTION DrawThemePrimaryGroup
  1236.     ENDIF
  1237.  
  1238. ;
  1239. ; pascal OSStatus DrawThemeSecondaryGroup(const Rect *rect, ThemeDrawState state)
  1240. ;
  1241.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1242.         Macro
  1243.         _DrawThemeSecondaryGroup
  1244.             move.w              #$000D,D0
  1245.             dc.w                $AA74
  1246.         EndM
  1247.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1248.         IMPORT_CFM_FUNCTION DrawThemeSecondaryGroup
  1249.     ENDIF
  1250.  
  1251. ;
  1252. ; pascal OSStatus DrawThemeSeparator(const Rect *rect, ThemeDrawState state)
  1253. ;
  1254.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1255.         Macro
  1256.         _DrawThemeSeparator
  1257.             move.w              #$000E,D0
  1258.             dc.w                $AA74
  1259.         EndM
  1260.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1261.         IMPORT_CFM_FUNCTION DrawThemeSeparator
  1262.     ENDIF
  1263.  
  1264.  
  1265. ; ——————————————————————————————————————————————————————————————————————————————————
  1266. ;     Window Manager APIs                                                                
  1267. ; ——————————————————————————————————————————————————————————————————————————————————
  1268. ;
  1269. ; pascal OSStatus GetWindowFeatures(WindowPtr window, UInt32 *features)
  1270. ;
  1271.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1272.         Macro
  1273.         _GetWindowFeatures
  1274.             move.w              #$0013,D0
  1275.             dc.w                $AA74
  1276.         EndM
  1277.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1278.         IMPORT_CFM_FUNCTION GetWindowFeatures
  1279.     ENDIF
  1280.  
  1281. ;
  1282. ; pascal Boolean IsWindowCollapsable(WindowPtr window)
  1283. ;
  1284.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1285.         Macro
  1286.         _IsWindowCollapsable
  1287.             move.w              #$000F,D0
  1288.             dc.w                $AA74
  1289.         EndM
  1290.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1291.         IMPORT_CFM_FUNCTION IsWindowCollapsable
  1292.     ENDIF
  1293.  
  1294. ;
  1295. ; pascal Boolean IsWindowCollapsed(WindowPtr window)
  1296. ;
  1297.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1298.         Macro
  1299.         _IsWindowCollapsed
  1300.             move.w              #$0010,D0
  1301.             dc.w                $AA74
  1302.         EndM
  1303.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1304.         IMPORT_CFM_FUNCTION IsWindowCollapsed
  1305.     ENDIF
  1306.  
  1307. ;
  1308. ; pascal OSStatus CollapseWindow(WindowPtr window, Boolean collapseIt)
  1309. ;
  1310.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1311.         Macro
  1312.         _CollapseWindow
  1313.             move.w              #$0011,D0
  1314.             dc.w                $AA74
  1315.         EndM
  1316.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1317.         IMPORT_CFM_FUNCTION CollapseWindow
  1318.     ENDIF
  1319.  
  1320. ;
  1321. ; pascal OSStatus CollapseAllWindows(Boolean collapseEm)
  1322. ;
  1323.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1324.         Macro
  1325.         _CollapseAllWindows
  1326.             move.w              #$0012,D0
  1327.             dc.w                $AA74
  1328.         EndM
  1329.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1330.         IMPORT_CFM_FUNCTION CollapseAllWindows
  1331.     ENDIF
  1332.  
  1333. ;
  1334. ; pascal OSStatus GetWindowRegion(WindowPtr window, WindowRegionCode regionCode, RgnHandle winRgn)
  1335. ;
  1336.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1337.         Macro
  1338.         _GetWindowRegion
  1339.             move.w              #$0014,D0
  1340.             dc.w                $AA74
  1341.         EndM
  1342.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1343.         IMPORT_CFM_FUNCTION GetWindowRegion
  1344.     ENDIF
  1345.  
  1346. ; ——————————————————————————————————————————————————————————————————————————————————
  1347. ;     Dialog Manager APIs                                                                
  1348. ; ——————————————————————————————————————————————————————————————————————————————————
  1349. ;
  1350. ; pascal DialogPtr NewFeaturesDialog(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 procID, WindowPtr behind, Boolean goAwayFlag, SInt32 refCon, Handle itmLstHndl, UInt32 flags)
  1351. ;
  1352.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1353.         Macro
  1354.         _NewFeaturesDialog
  1355.             move.w              #$110C,D0
  1356.             dc.w                $AA68
  1357.         EndM
  1358.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1359.         IMPORT_CFM_FUNCTION NewFeaturesDialog
  1360.     ENDIF
  1361.  
  1362. ;
  1363. ; pascal OSErr AutoSizeDialog(DialogPtr dialog)
  1364. ;
  1365.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1366.         Macro
  1367.         _AutoSizeDialog
  1368.             move.w              #$020D,D0
  1369.             dc.w                $AA68
  1370.         EndM
  1371.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1372.         IMPORT_CFM_FUNCTION AutoSizeDialog
  1373.     ENDIF
  1374.  
  1375. ;
  1376. ; pascal OSErr StandardAlert(AlertType alertType, StringPtr error, StringPtr explanation, AlertStdAlertParamPtr alertParam, SInt16 *itemHit)
  1377. ;
  1378.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1379.         Macro
  1380.         _StandardAlert
  1381.             move.w              #$090E,D0
  1382.             dc.w                $AA68
  1383.         EndM
  1384.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1385.         IMPORT_CFM_FUNCTION StandardAlert
  1386.     ENDIF
  1387.  
  1388. ;
  1389. ; pascal OSErr GetDialogItemAsControl(DialogPtr dialog, SInt16 itemNo, ControlHandle *control)
  1390. ;
  1391.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1392.         Macro
  1393.         _GetDialogItemAsControl
  1394.             move.w              #$050F,D0
  1395.             dc.w                $AA68
  1396.         EndM
  1397.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1398.         IMPORT_CFM_FUNCTION GetDialogItemAsControl
  1399.     ENDIF
  1400.  
  1401. ;
  1402. ; pascal OSErr MoveDialogItem(DialogPtr dialog, SInt16 itemNo, SInt16 horiz, SInt16 vert)
  1403. ;
  1404.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1405.         Macro
  1406.         _MoveDialogItem
  1407.             move.w              #$0510,D0
  1408.             dc.w                $AA68
  1409.         EndM
  1410.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1411.         IMPORT_CFM_FUNCTION MoveDialogItem
  1412.     ENDIF
  1413.  
  1414. ;
  1415. ; pascal OSErr SizeDialogItem(DialogPtr dialog, SInt16 itemNo, SInt16 height, SInt16 width)
  1416. ;
  1417.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1418.         Macro
  1419.         _SizeDialogItem
  1420.             move.w              #$0511,D0
  1421.             dc.w                $AA68
  1422.         EndM
  1423.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1424.         IMPORT_CFM_FUNCTION SizeDialogItem
  1425.     ENDIF
  1426.  
  1427. ; ——————————————————————————————————————————————————————————————————————————————————
  1428. ;     Control Manager APIs                                                            
  1429. ; ——————————————————————————————————————————————————————————————————————————————————
  1430.  
  1431. ;   These routines are available only thru the shared library/glue
  1432. ;   Bevel button routines
  1433.  
  1434.  
  1435.  
  1436. ;
  1437. ; pascal OSErr GetBevelButtonMenuValue(ControlHandle button, SInt16 *value)
  1438. ;
  1439.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1440.         IMPORT_CFM_FUNCTION GetBevelButtonMenuValue
  1441.     ENDIF
  1442.  
  1443. ;
  1444. ; pascal OSErr SetBevelButtonMenuValue(ControlHandle button, SInt16 value)
  1445. ;
  1446.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1447.         IMPORT_CFM_FUNCTION SetBevelButtonMenuValue
  1448.     ENDIF
  1449.  
  1450. ;
  1451. ; pascal OSErr GetBevelButtonMenuHandle(ControlHandle button, MenuHandle *handle)
  1452. ;
  1453.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1454.         IMPORT_CFM_FUNCTION GetBevelButtonMenuHandle
  1455.     ENDIF
  1456.  
  1457. ;
  1458. ; pascal OSErr GetBevelButtonContentInfo(ControlHandle button, ControlButtonContentInfoPtr content)
  1459. ;
  1460.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1461.         IMPORT_CFM_FUNCTION GetBevelButtonContentInfo
  1462.     ENDIF
  1463.  
  1464. ;
  1465. ; pascal OSErr SetBevelButtonContentInfo(ControlHandle button, ControlButtonContentInfoPtr content)
  1466. ;
  1467.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1468.         IMPORT_CFM_FUNCTION SetBevelButtonContentInfo
  1469.     ENDIF
  1470.  
  1471. ;
  1472. ; pascal OSErr SetBevelButtonTransform(ControlHandle button, IconTransformType transform)
  1473. ;
  1474.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1475.         IMPORT_CFM_FUNCTION SetBevelButtonTransform
  1476.     ENDIF
  1477.  
  1478. ;
  1479. ; pascal OSErr SetBevelButtonGraphicAlignment(ControlHandle button, ControlButtonGraphicAlignment align, SInt16 hOffset, SInt16 vOffset)
  1480. ;
  1481.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1482.         IMPORT_CFM_FUNCTION SetBevelButtonGraphicAlignment
  1483.     ENDIF
  1484.  
  1485. ;
  1486. ; pascal OSErr SetBevelButtonTextAlignment(ControlHandle button, ControlButtonTextAlignment align, SInt16 hOffset)
  1487. ;
  1488.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1489.         IMPORT_CFM_FUNCTION SetBevelButtonTextAlignment
  1490.     ENDIF
  1491.  
  1492. ;
  1493. ; pascal OSErr SetBevelButtonTextPlacement(ControlHandle button, ControlButtonTextPlacement where)
  1494. ;
  1495.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1496.         IMPORT_CFM_FUNCTION SetBevelButtonTextPlacement
  1497.     ENDIF
  1498.  
  1499. ;  Image well routines
  1500.  
  1501. ;
  1502. ; pascal OSErr GetImageWellContentInfo(ControlHandle button, ControlButtonContentInfoPtr content)
  1503. ;
  1504.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1505.         IMPORT_CFM_FUNCTION GetImageWellContentInfo
  1506.     ENDIF
  1507.  
  1508. ;
  1509. ; pascal OSErr SetImageWellContentInfo(ControlHandle button, ControlButtonContentInfoPtr content)
  1510. ;
  1511.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1512.         IMPORT_CFM_FUNCTION SetImageWellContentInfo
  1513.     ENDIF
  1514.  
  1515. ;
  1516. ; pascal OSErr SetImageWellTransform(ControlHandle button, IconTransformType transform)
  1517. ;
  1518.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1519.         IMPORT_CFM_FUNCTION SetImageWellTransform
  1520.     ENDIF
  1521.  
  1522. ;  Tab routines
  1523.  
  1524. ;
  1525. ; pascal OSErr GetTabContentRect(ControlHandle tabControl, Rect *contentRect)
  1526. ;
  1527.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1528.         IMPORT_CFM_FUNCTION GetTabContentRect
  1529.     ENDIF
  1530.  
  1531. ;
  1532. ; pascal OSErr SetTabEnabled(ControlHandle tabControl, SInt16 tabToHilite, Boolean enabled)
  1533. ;
  1534.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1535.         IMPORT_CFM_FUNCTION SetTabEnabled
  1536.     ENDIF
  1537.  
  1538. ;  Disclosure triangles
  1539.  
  1540. ;
  1541. ; pascal OSErr SetDisclosureTriangleLastValue(ControlHandle tabControl, SInt16 value)
  1542. ;
  1543.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1544.         IMPORT_CFM_FUNCTION SetDisclosureTriangleLastValue
  1545.     ENDIF
  1546.  
  1547. ;  Trap-based routines
  1548.  
  1549. ;
  1550. ; pascal SInt32 SendControlMessage(ControlHandle theControl, SInt16 message, SInt32 param)
  1551. ;
  1552.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1553.         Macro
  1554.         _SendControlMessage
  1555.             move.w              #$FFFE,D0
  1556.             dc.w                $AA73
  1557.         EndM
  1558.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1559.         IMPORT_CFM_FUNCTION SendControlMessage
  1560.     ENDIF
  1561.  
  1562. ;
  1563. ; pascal OSErr DumpControlHierarchy(WindowPtr window, const FSSpec *outFile)
  1564. ;
  1565.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1566.         Macro
  1567.         _DumpControlHierarchy
  1568.             move.w              #$FFFF,D0
  1569.             dc.w                $AA73
  1570.         EndM
  1571.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1572.         IMPORT_CFM_FUNCTION DumpControlHierarchy
  1573.     ENDIF
  1574.  
  1575. ;
  1576. ; pascal OSErr CreateRootControl(WindowPtr window, ControlHandle *control)
  1577. ;
  1578.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1579.         Macro
  1580.         _CreateRootControl
  1581.             move.w              #$0001,D0
  1582.             dc.w                $AA73
  1583.         EndM
  1584.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1585.         IMPORT_CFM_FUNCTION CreateRootControl
  1586.     ENDIF
  1587.  
  1588. ;
  1589. ; pascal OSErr GetRootControl(WindowPtr window, ControlHandle *control)
  1590. ;
  1591.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1592.         Macro
  1593.         _GetRootControl
  1594.             move.w              #$0002,D0
  1595.             dc.w                $AA73
  1596.         EndM
  1597.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1598.         IMPORT_CFM_FUNCTION GetRootControl
  1599.     ENDIF
  1600.  
  1601. ;
  1602. ; pascal OSErr EmbedControl(ControlHandle control, ControlHandle container)
  1603. ;
  1604.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1605.         Macro
  1606.         _EmbedControl
  1607.             move.w              #$0003,D0
  1608.             dc.w                $AA73
  1609.         EndM
  1610.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1611.         IMPORT_CFM_FUNCTION EmbedControl
  1612.     ENDIF
  1613.  
  1614. ;
  1615. ; pascal OSErr AutoEmbedControl(ControlHandle control, WindowPtr window)
  1616. ;
  1617.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1618.         Macro
  1619.         _AutoEmbedControl
  1620.             move.w              #$0004,D0
  1621.             dc.w                $AA73
  1622.         EndM
  1623.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1624.         IMPORT_CFM_FUNCTION AutoEmbedControl
  1625.     ENDIF
  1626.  
  1627. ;
  1628. ; pascal Boolean IsControlActive(ControlHandle control)
  1629. ;
  1630.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1631.         Macro
  1632.         _IsControlActive
  1633.             move.w              #$0005,D0
  1634.             dc.w                $AA73
  1635.         EndM
  1636.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1637.         IMPORT_CFM_FUNCTION IsControlActive
  1638.     ENDIF
  1639.  
  1640. ;
  1641. ; pascal Boolean IsControlVisible(ControlHandle control)
  1642. ;
  1643.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1644.         Macro
  1645.         _IsControlVisible
  1646.             move.w              #$0006,D0
  1647.             dc.w                $AA73
  1648.         EndM
  1649.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1650.         IMPORT_CFM_FUNCTION IsControlVisible
  1651.     ENDIF
  1652.  
  1653. ;
  1654. ; pascal OSErr ActivateControl(ControlHandle control)
  1655. ;
  1656.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1657.         Macro
  1658.         _ActivateControl
  1659.             move.w              #$0007,D0
  1660.             dc.w                $AA73
  1661.         EndM
  1662.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1663.         IMPORT_CFM_FUNCTION ActivateControl
  1664.     ENDIF
  1665.  
  1666. ;
  1667. ; pascal OSErr DeactivateControl(ControlHandle control)
  1668. ;
  1669.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1670.         Macro
  1671.         _DeactivateControl
  1672.             move.w              #$0008,D0
  1673.             dc.w                $AA73
  1674.         EndM
  1675.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1676.         IMPORT_CFM_FUNCTION DeactivateControl
  1677.     ENDIF
  1678.  
  1679. ;
  1680. ; pascal ControlHandle FindControlUnderMouse(Point where, WindowPtr window, SInt16 *part)
  1681. ;
  1682.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1683.         Macro
  1684.         _FindControlUnderMouse
  1685.             move.w              #$0009,D0
  1686.             dc.w                $AA73
  1687.         EndM
  1688.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1689.         IMPORT_CFM_FUNCTION FindControlUnderMouse
  1690.     ENDIF
  1691.  
  1692. ;
  1693. ; pascal SInt16 HandleControlClick(ControlHandle control, Point where, SInt16 modifiers, ControlActionUPP action)
  1694. ;
  1695.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1696.         Macro
  1697.         _HandleControlClick
  1698.             move.w              #$000A,D0
  1699.             dc.w                $AA73
  1700.         EndM
  1701.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1702.         IMPORT_CFM_FUNCTION HandleControlClick
  1703.     ENDIF
  1704.  
  1705. ;
  1706. ; pascal SInt16 HandleControlKey(ControlHandle control, SInt16 keyCode, SInt16 charCode, SInt16 modifiers)
  1707. ;
  1708.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1709.         Macro
  1710.         _HandleControlKey
  1711.             move.w              #$000B,D0
  1712.             dc.w                $AA73
  1713.         EndM
  1714.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1715.         IMPORT_CFM_FUNCTION HandleControlKey
  1716.     ENDIF
  1717.  
  1718. ;
  1719. ; pascal void IdleControls(WindowPtr window)
  1720. ;
  1721.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1722.         Macro
  1723.         _IdleControls
  1724.             move.w              #$000C,D0
  1725.             dc.w                $AA73
  1726.         EndM
  1727.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1728.         IMPORT_CFM_FUNCTION IdleControls
  1729.     ENDIF
  1730.  
  1731. ;
  1732. ; pascal OSErr GetKeyboardFocus(WindowPtr window, ControlHandle *control)
  1733. ;
  1734.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1735.         Macro
  1736.         _GetKeyboardFocus
  1737.             move.w              #$000D,D0
  1738.             dc.w                $AA73
  1739.         EndM
  1740.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1741.         IMPORT_CFM_FUNCTION GetKeyboardFocus
  1742.     ENDIF
  1743.  
  1744. ;
  1745. ; pascal OSErr SetKeyboardFocus(WindowPtr window, ControlHandle control, ControlFocusPart part)
  1746. ;
  1747.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1748.         Macro
  1749.         _SetKeyboardFocus
  1750.             move.w              #$000E,D0
  1751.             dc.w                $AA73
  1752.         EndM
  1753.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1754.         IMPORT_CFM_FUNCTION SetKeyboardFocus
  1755.     ENDIF
  1756.  
  1757. ;
  1758. ; pascal OSErr AdvanceKeyboardFocus(WindowPtr window)
  1759. ;
  1760.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1761.         Macro
  1762.         _AdvanceKeyboardFocus
  1763.             move.w              #$000F,D0
  1764.             dc.w                $AA73
  1765.         EndM
  1766.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1767.         IMPORT_CFM_FUNCTION AdvanceKeyboardFocus
  1768.     ENDIF
  1769.  
  1770. ;
  1771. ; pascal OSErr ReverseKeyboardFocus(WindowPtr window)
  1772. ;
  1773.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1774.         Macro
  1775.         _ReverseKeyboardFocus
  1776.             move.w              #$0010,D0
  1777.             dc.w                $AA73
  1778.         EndM
  1779.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1780.         IMPORT_CFM_FUNCTION ReverseKeyboardFocus
  1781.     ENDIF
  1782.  
  1783. ;
  1784. ; pascal OSErr GetControlFeatures(ControlHandle control, UInt32 *features)
  1785. ;
  1786.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1787.         Macro
  1788.         _GetControlFeatures
  1789.             move.w              #$0011,D0
  1790.             dc.w                $AA73
  1791.         EndM
  1792.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1793.         IMPORT_CFM_FUNCTION GetControlFeatures
  1794.     ENDIF
  1795.  
  1796. ;
  1797. ; pascal OSErr SetControlData(ControlHandle control, ControlPartCode part, ResType tagName, Size size, Ptr data)
  1798. ;
  1799.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1800.         Macro
  1801.         _SetControlData
  1802.             move.w              #$0012,D0
  1803.             dc.w                $AA73
  1804.         EndM
  1805.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1806.         IMPORT_CFM_FUNCTION SetControlData
  1807.     ENDIF
  1808.  
  1809. ;
  1810. ; pascal OSErr GetControlData(ControlHandle control, ControlPartCode part, ResType tagName, Size bufferSize, Ptr buffer, Size *actualSize)
  1811. ;
  1812.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1813.         Macro
  1814.         _GetControlData
  1815.             move.w              #$0013,D0
  1816.             dc.w                $AA73
  1817.         EndM
  1818.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1819.         IMPORT_CFM_FUNCTION GetControlData
  1820.     ENDIF
  1821.  
  1822. ;
  1823. ; pascal OSErr GetControlDataSize(ControlHandle control, ControlPartCode part, ResType tagName, Size *maxSize)
  1824. ;
  1825.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1826.         Macro
  1827.         _GetControlDataSize
  1828.             move.w              #$0014,D0
  1829.             dc.w                $AA73
  1830.         EndM
  1831.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1832.         IMPORT_CFM_FUNCTION GetControlDataSize
  1833.     ENDIF
  1834.  
  1835. ;
  1836. ; pascal OSErr GetSuperControl(ControlHandle control, ControlHandle *parent)
  1837. ;
  1838.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1839.         Macro
  1840.         _GetSuperControl
  1841.             move.w              #$0015,D0
  1842.             dc.w                $AA73
  1843.         EndM
  1844.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1845.         IMPORT_CFM_FUNCTION GetSuperControl
  1846.     ENDIF
  1847.  
  1848. ;
  1849. ; pascal OSErr CountSubControls(ControlHandle control, SInt16 *numChildren)
  1850. ;
  1851.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1852.         Macro
  1853.         _CountSubControls
  1854.             move.w              #$0016,D0
  1855.             dc.w                $AA73
  1856.         EndM
  1857.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1858.         IMPORT_CFM_FUNCTION CountSubControls
  1859.     ENDIF
  1860.  
  1861. ;
  1862. ; pascal OSErr GetIndexedSubControl(ControlHandle control, SInt16 index, ControlHandle *subControl)
  1863. ;
  1864.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1865.         Macro
  1866.         _GetIndexedSubControl
  1867.             move.w              #$0017,D0
  1868.             dc.w                $AA73
  1869.         EndM
  1870.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1871.         IMPORT_CFM_FUNCTION GetIndexedSubControl
  1872.     ENDIF
  1873.  
  1874. ;
  1875. ; pascal void DrawControlInCurrentPort(ControlHandle theControl)
  1876. ;
  1877.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1878.         Macro
  1879.         _DrawControlInCurrentPort
  1880.             move.w              #$0018,D0
  1881.             dc.w                $AA73
  1882.         EndM
  1883.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1884.         IMPORT_CFM_FUNCTION DrawControlInCurrentPort
  1885.     ENDIF
  1886.  
  1887. ;
  1888. ; pascal OSErr ClearKeyboardFocus(WindowPtr window)
  1889. ;
  1890.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1891.         Macro
  1892.         _ClearKeyboardFocus
  1893.             move.w              #$0019,D0
  1894.             dc.w                $AA73
  1895.         EndM
  1896.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1897.         IMPORT_CFM_FUNCTION ClearKeyboardFocus
  1898.     ENDIF
  1899.  
  1900. ;
  1901. ; pascal OSErr SetControlSupervisor(ControlHandle control, ControlHandle boss)
  1902. ;
  1903.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1904.         Macro
  1905.         _SetControlSupervisor
  1906.             move.w              #$001A,D0
  1907.             dc.w                $AA73
  1908.         EndM
  1909.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1910.         IMPORT_CFM_FUNCTION SetControlSupervisor
  1911.     ENDIF
  1912.  
  1913. ;
  1914. ; pascal OSErr GetBestControlRect(ControlHandle control, Rect *rect, SInt16 *baseLineOffset)
  1915. ;
  1916.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1917.         Macro
  1918.         _GetBestControlRect
  1919.             move.w              #$001B,D0
  1920.             dc.w                $AA73
  1921.         EndM
  1922.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1923.         IMPORT_CFM_FUNCTION GetBestControlRect
  1924.     ENDIF
  1925.  
  1926. ;
  1927. ; pascal OSErr SetControlFontStyle(ControlHandle control, ControlFontStyleRec *style)
  1928. ;
  1929.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1930.         Macro
  1931.         _SetControlFontStyle
  1932.             move.w              #$001C,D0
  1933.             dc.w                $AA73
  1934.         EndM
  1935.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1936.         IMPORT_CFM_FUNCTION SetControlFontStyle
  1937.     ENDIF
  1938.  
  1939. ;
  1940. ; pascal OSErr SetUpControlBackground(ControlHandle control, SInt16 depth, Boolean colorDevice)
  1941. ;
  1942.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1943.         Macro
  1944.         _SetUpControlBackground
  1945.             move.w              #$001D,D0
  1946.             dc.w                $AA73
  1947.         EndM
  1948.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1949.         IMPORT_CFM_FUNCTION SetUpControlBackground
  1950.     ENDIF
  1951.  
  1952. ;
  1953. ; pascal OSErr SetControlVisibility(ControlHandle control, Boolean isVisible, Boolean draw)
  1954. ;
  1955.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1956.         Macro
  1957.         _SetControlVisibility
  1958.             move.w              #$001E,D0
  1959.             dc.w                $AA73
  1960.         EndM
  1961.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1962.         IMPORT_CFM_FUNCTION SetControlVisibility
  1963.     ENDIF
  1964.  
  1965. ; ——————————————————————————————————————————————————————————————————————————————————
  1966. ;     Menu Manager APIs                                                                
  1967. ; ——————————————————————————————————————————————————————————————————————————————————
  1968. ;
  1969. ; pascal UInt32 MenuEvent(const EventRecord *event)
  1970. ;
  1971.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1972.         Macro
  1973.         _MenuEvent
  1974.             move.w              #$020C,D0
  1975.             dc.w                $A825
  1976.         EndM
  1977.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1978.         IMPORT_CFM_FUNCTION MenuEvent
  1979.     ENDIF
  1980.  
  1981. ;
  1982. ; pascal OSErr SetMenuItemCommandID(MenuHandle menu, SInt16 item, UInt32 commandID)
  1983. ;
  1984.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1985.         Macro
  1986.         _SetMenuItemCommandID
  1987.             move.w              #$0502,D0
  1988.             dc.w                $A825
  1989.         EndM
  1990.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1991.         IMPORT_CFM_FUNCTION SetMenuItemCommandID
  1992.     ENDIF
  1993.  
  1994. ;
  1995. ; pascal OSErr GetMenuItemCommandID(MenuHandle menu, SInt16 item, UInt32 *commandID)
  1996. ;
  1997.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1998.         Macro
  1999.         _GetMenuItemCommandID
  2000.             move.w              #$0503,D0
  2001.             dc.w                $A825
  2002.         EndM
  2003.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2004.         IMPORT_CFM_FUNCTION GetMenuItemCommandID
  2005.     ENDIF
  2006.  
  2007. ;
  2008. ; pascal OSErr SetMenuItemModifiers(MenuHandle menu, SInt16 item, UInt8 modifiers)
  2009. ;
  2010.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2011.         Macro
  2012.         _SetMenuItemModifiers
  2013.             move.w              #$0404,D0
  2014.             dc.w                $A825
  2015.         EndM
  2016.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2017.         IMPORT_CFM_FUNCTION SetMenuItemModifiers
  2018.     ENDIF
  2019.  
  2020. ;
  2021. ; pascal OSErr GetMenuItemModifiers(MenuHandle menu, SInt16 item, UInt8 *modifiers)
  2022. ;
  2023.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2024.         Macro
  2025.         _GetMenuItemModifiers
  2026.             move.w              #$0505,D0
  2027.             dc.w                $A825
  2028.         EndM
  2029.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2030.         IMPORT_CFM_FUNCTION GetMenuItemModifiers
  2031.     ENDIF
  2032.  
  2033. ;
  2034. ; pascal OSErr SetMenuItemIconHandle(MenuHandle menu, SInt16 item, UInt8 iconType, Handle icon)
  2035. ;
  2036.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2037.         Macro
  2038.         _SetMenuItemIconHandle
  2039.             move.w              #$0606,D0
  2040.             dc.w                $A825
  2041.         EndM
  2042.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2043.         IMPORT_CFM_FUNCTION SetMenuItemIconHandle
  2044.     ENDIF
  2045.  
  2046. ;
  2047. ; pascal OSErr GetMenuItemIconHandle(MenuHandle menu, SInt16 item, UInt8 *iconType, Handle *icon)
  2048. ;
  2049.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2050.         Macro
  2051.         _GetMenuItemIconHandle
  2052.             move.w              #$0707,D0
  2053.             dc.w                $A825
  2054.         EndM
  2055.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2056.         IMPORT_CFM_FUNCTION GetMenuItemIconHandle
  2057.     ENDIF
  2058.  
  2059. ;
  2060. ; pascal OSErr SetMenuItemTextEncoding(MenuHandle menu, SInt16 item, TextEncoding scriptID)
  2061. ;
  2062.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2063.         Macro
  2064.         _SetMenuItemTextEncoding
  2065.             move.w              #$0408,D0
  2066.             dc.w                $A825
  2067.         EndM
  2068.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2069.         IMPORT_CFM_FUNCTION SetMenuItemTextEncoding
  2070.     ENDIF
  2071.  
  2072. ;
  2073. ; pascal OSErr GetMenuItemTextEncoding(MenuHandle menu, SInt16 item, TextEncoding *scriptID)
  2074. ;
  2075.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2076.         Macro
  2077.         _GetMenuItemTextEncoding
  2078.             move.w              #$0509,D0
  2079.             dc.w                $A825
  2080.         EndM
  2081.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2082.         IMPORT_CFM_FUNCTION GetMenuItemTextEncoding
  2083.     ENDIF
  2084.  
  2085. ;
  2086. ; pascal OSErr SetMenuItemHierarchicalID(MenuHandle menu, SInt16 item, SInt16 hierID)
  2087. ;
  2088.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2089.         Macro
  2090.         _SetMenuItemHierarchicalID
  2091.             move.w              #$040D,D0
  2092.             dc.w                $A825
  2093.         EndM
  2094.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2095.         IMPORT_CFM_FUNCTION SetMenuItemHierarchicalID
  2096.     ENDIF
  2097.  
  2098. ;
  2099. ; pascal OSErr GetMenuItemHierarchicalID(MenuHandle menu, SInt16 item, SInt16 *hierID)
  2100. ;
  2101.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2102.         Macro
  2103.         _GetMenuItemHierarchicalID
  2104.             move.w              #$050E,D0
  2105.             dc.w                $A825
  2106.         EndM
  2107.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2108.         IMPORT_CFM_FUNCTION GetMenuItemHierarchicalID
  2109.     ENDIF
  2110.  
  2111. ;
  2112. ; pascal OSErr SetMenuItemFontID(MenuHandle menu, SInt16 item, SInt16 fontID)
  2113. ;
  2114.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2115.         Macro
  2116.         _SetMenuItemFontID
  2117.             move.w              #$040F,D0
  2118.             dc.w                $A825
  2119.         EndM
  2120.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2121.         IMPORT_CFM_FUNCTION SetMenuItemFontID
  2122.     ENDIF
  2123.  
  2124. ;
  2125. ; pascal OSErr GetMenuItemFontID(MenuHandle menu, SInt16 item, SInt16 *fontID)
  2126. ;
  2127.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2128.         Macro
  2129.         _GetMenuItemFontID
  2130.             move.w              #$0510,D0
  2131.             dc.w                $A825
  2132.         EndM
  2133.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2134.         IMPORT_CFM_FUNCTION GetMenuItemFontID
  2135.     ENDIF
  2136.  
  2137. ;
  2138. ; pascal OSErr SetMenuItemRefCon(MenuHandle menu, SInt16 item, UInt32 refCon)
  2139. ;
  2140.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2141.         Macro
  2142.         _SetMenuItemRefCon
  2143.             move.w              #$050A,D0
  2144.             dc.w                $A825
  2145.         EndM
  2146.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2147.         IMPORT_CFM_FUNCTION SetMenuItemRefCon
  2148.     ENDIF
  2149.  
  2150. ;
  2151. ; pascal OSErr GetMenuItemRefCon(MenuHandle menu, SInt16 item, UInt32 *refCon)
  2152. ;
  2153.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2154.         Macro
  2155.         _GetMenuItemRefCon
  2156.             move.w              #$050B,D0
  2157.             dc.w                $A825
  2158.         EndM
  2159.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2160.         IMPORT_CFM_FUNCTION GetMenuItemRefCon
  2161.     ENDIF
  2162.  
  2163. ;
  2164. ; pascal OSErr SetMenuItemRefCon2(MenuHandle menu, SInt16 item, UInt32 refCon2)
  2165. ;
  2166.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2167.         Macro
  2168.         _SetMenuItemRefCon2
  2169.             move.w              #$0511,D0
  2170.             dc.w                $A825
  2171.         EndM
  2172.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2173.         IMPORT_CFM_FUNCTION SetMenuItemRefCon2
  2174.     ENDIF
  2175.  
  2176. ;
  2177. ; pascal OSErr GetMenuItemRefCon2(MenuHandle menu, SInt16 item, UInt32 *refCon2)
  2178. ;
  2179.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2180.         Macro
  2181.         _GetMenuItemRefCon2
  2182.             move.w              #$0512,D0
  2183.             dc.w                $A825
  2184.         EndM
  2185.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2186.         IMPORT_CFM_FUNCTION GetMenuItemRefCon2
  2187.     ENDIF
  2188.  
  2189. ;
  2190. ; pascal OSErr SetMenuItemKeyGlyph(MenuHandle menu, SInt16 item, SInt16 glyph)
  2191. ;
  2192.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2193.         Macro
  2194.         _SetMenuItemKeyGlyph
  2195.             move.w              #$0513,D0
  2196.             dc.w                $A825
  2197.         EndM
  2198.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2199.         IMPORT_CFM_FUNCTION SetMenuItemKeyGlyph
  2200.     ENDIF
  2201.  
  2202. ;
  2203. ; pascal OSErr GetMenuItemKeyGlyph(MenuHandle menu, SInt16 item, SInt16 *glyph)
  2204. ;
  2205.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2206.         Macro
  2207.         _GetMenuItemKeyGlyph
  2208.             move.w              #$0514,D0
  2209.             dc.w                $A825
  2210.         EndM
  2211.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2212.         IMPORT_CFM_FUNCTION GetMenuItemKeyGlyph
  2213.     ENDIF
  2214.  
  2215.     ENDIF ; __APPEARANCE__ 
  2216.  
  2217.